import { defHttp } from "@/utils/http";

// ERP 投标记录 VO
export interface BidBiddingVO {
	id: number; // 主键
	parentId: number; // 父级ID
	unitCode: string; // 单位编码
	no: string; // 编号
	date: Date; // 时间
	startDate: Date; // 从
	endDate: Date; // 到
	notes: string; // 备注
	printCount: number; // 打印次数
	isCompleted: string; // 是否完成
	userId: number; // 用户ID
}

// ERP 投标记录 API
export const BidBiddingApi = {
	// 查询投标记录分页
	getBidBiddingPage: async (params: any) => {
		return await defHttp.get({ url: `/whs/bidding/page`, params });
	},

	// 查询投标记录详情
	getBidBidding: async (id: number) => {
		return await defHttp.get({ url: `/whs/bidding/get?id=` + id });
	},

	// 新增投标记录
	createBidBidding: async (data: BidBiddingVO) => {
		return await defHttp.post({ url: `/whs/bidding/create`, data });
	},

	// 修改投标记录
	updateBidBidding: async (data: BidBiddingVO) => {
		return await defHttp.put({ url: `/whs/bidding/update`, data });
	},

	// 删除投标记录
	deleteBidBidding: async (id: number) => {
		return await defHttp.delete({
			url: `/whs/bidding/delete?id=` + id
		});
	},

	// 导出投标记录 Excel
	exportBidBidding: async (params: any) => {
		return await defHttp.download({ url: `/whs/bidding/export-excel`, params });
	}
};
